<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>入库通知管理</title>
	<meta name="decorator" content="ani"/>
	<style>#searchresult
	{
		width: 260px;
		position: absolute;
		z-index: 1;
		overflow: hidden;
		left: 140px;
		top: 71px;
		background: #E0E0E0;
		border-top: none;

	}

	.line
	{
		font-size: 15px;
		background: #E0E0E0;
		width: 140px;
		padding:0px;
	}
	.hover
	{
		background: #007ab8;
		width: 140px;
		color: #fff;
	}
	.std
	{
		width: 150px;
	}
		#searchresult1
		{
			width: 260px;
			position: absolute;
			z-index: 1;
			overflow: hidden;
			left: 140px;
			top: 71px;
			background: #E0E0E0;
			border-top: none;

		}

		.line1
		{
			font-size: 15px;
			background: #E0E0E0;
			width: 140px;
			padding:0px;
		}
		.hover1
		{
			background: #007ab8;
			width: 140px;
			color: #fff;
		}
		.std1
		{
			width: 150px;
		}
		#searchresult2
		{
			width: 260px;
			position: absolute;
			z-index: 1;
			overflow: hidden;
			left: 140px;
			top: 71px;
			background: #E0E0E0;
			border-top: none;

		}

		.line2
		{
			font-size: 15px;
			background: #E0E0E0;
			width: 140px;
			padding:0px;
		}
		.hover2
		{
			background: #007ab8;
			width: 140px;
			color: #fff;
		}
		.std2
		{
			width: 150px;
		}
	#searchresult6
	{
		width: 260px;
		position: absolute;
		z-index: 1;
		overflow: hidden;
		left: 140px;
		top: 71px;
		background: #E0E0E0;
		border-top: none;

	}

	.line6
	{
		font-size: 15px;
		background: #E0E0E0;
		width: 140px;
		padding:0px;
	}
	#searchresult5
	{
		width: 260px;
		position: absolute;
		z-index: 1;
		overflow: hidden;
		left: 140px;
		top: 71px;
		background: #E0E0E0;
		border-top: none;

	}

	.line5
	{
		font-size: 15px;
		background: #E0E0E0;
		width: 140px;
		padding:0px;
	}
	</style>
	<script type="text/javascript">
		var validateForm;
		var $table; // 父页面table表格id
		var $topIndex;//弹出窗口的 index
		function doSubmit(table, index){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $table = table;
			  $topIndex = index;
			  jp.loading();
			  $("#inputForm").submit();
			  return true;
		  }

		  return false;
		}

		$(document).ready(function() {
			validateForm = $("#inputForm").validate({
				submitHandler: function(form){
					jp.post("${ctx}/wms/storageInform/save",$('#inputForm').serialize(),function(data){
						if(data.success){
	                    	$table.bootstrapTable('refresh');
	                    	jp.success(data.msg);
	                    	jp.close($topIndex);//关闭dialog

	                    }else{
            	  			jp.error(data.msg);
	                    }
					})
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
	        $('#receivingDate').datetimepicker({
				 format: "YYYY-MM-DD HH:00"
		    });
	        $('#expectDate').datetimepicker({
				 format: "YYYY-MM-DD HH:00"
		    });
	        $('#arrivalDate').datetimepicker({
				 format: "YYYY-MM-DD HH:00"
		    });
		});
		
		function addRow(list, idx, tpl, row){
			$(list).append(Mustache.render(tpl, {
				idx: idx, delBtn: true, row: row
			}));
			$(list+idx).find("select").each(function(){
				$(this).val($(this).attr("data-value"));
			});
			$(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
				var ss = $(this).attr("data-value").split(',');
				for (var i=0; i<ss.length; i++){
					if($(this).val() == ss[i]){
						$(this).attr("checked","checked");
					}
				}
			});
			$(list+idx).find(".form_datetime").each(function(){
				 $(this).datetimepicker({
					 format: "YYYY-MM-DD HH:00"
			    });
			});
		}
		function delRow(obj, prefix){
			var id = $(prefix+"_id");
			var delFlag = $(prefix+"_delFlag");
			if (id.val() == ""){
				$(obj).parent().parent().remove();
			}else if(delFlag.val() == "0"){
				delFlag.val("1");
				$(obj).html("&divide;").attr("title", "撤销删除");
				$(obj).parent().parent().addClass("error");
			}else if(delFlag.val() == "1"){
				delFlag.val("0");
				$(obj).html("&times;").attr("title", "删除");
				$(obj).parent().parent().removeClass("error");
			}
		}
        function tt(id,idx) {
            $.ajax({
                url:'${ctx}/infor/goods/getById?i='+id,
                success:function (data) {
                    $("#materialParticularsList"+idx+"_materialName0").val(data.id) ;
                    $("#materialParticularsList"+idx+"_forecast").val("") ;
                    $("#materialParticularsList"+idx+"_materialCode").val(data.code) ;
                    $("#materialParticularsList"+idx+"_materialSpecification").val(data.specifications) ;
                    $("#materialParticularsList"+idx+"_roughWeight").val(data.grossWeight) ;
                    $("#materialParticularsList"+idx+"_volume").val(data.volume) ;
                    $("#materialParticularsList"+idx+"_weight").val(data.weight);
                    $("#materialParticularsList"+idx+"_packingUnit").val(data.packing) ;
                    $("#materialParticularsList"+idx+"_packing").val(data.type.name) ;

                }


            })

        }
        function tt1(id,idx) {
            $.ajax({
                url:'${ctx}/infor/goods/getById?i='+id,
                success:function (data) {
                    $("#materialParticularsList"+idx+"_materialName").val(data.name) ;
                    $("#materialParticularsList"+idx+"_forecast").val("") ;
                    $("#materialParticularsList"+idx+"_materialName0").val(data.id) ;
                    $("#materialParticularsList"+idx+"_materialSpecification").val(data.specifications) ;
                    $("#materialParticularsList"+idx+"_packingUnit").val(data.packing) ;
                    $("#materialParticularsList"+idx+"_roughWeight").val(data.grossWeight) ;
                    $("#materialParticularsList"+idx+"_volume").val(data.volume) ;
                    $("#materialParticularsList"+idx+"_weight").val(data.weight);
                    $("#materialParticularsList"+idx+"_packing").val(data.type.name) ;



                }


            })

        }
        function se0(evt,id,idx) {
            ChangeCoords1(id); //控制查询结果div坐标

            var k = window.event ? evt.keyCode : evt.which;
            //输入框的id为txt_search，这里监听输入框的keyup事件
            //不为空 && 不为上箭头或下箭头或回车
            if ($("#"+id).val() != "" && k == 13) {
                $.ajax({
                    type: 'post',
                    async: true, //同步执行，不然会有问题
                    dataType: "json",
                    url: "${ctx}/infor/goods/getGoodsByName?name="+$("#"+id).val(),   //提交的页面/方法
                    error: function (msg) {//请求失败处理函数
                        alert("数据加载失败");
                    },
                    success: function (data) { //请求成功后处理函数。
						/*  var objData = eval("(" + data.userName + ")");   */
                        console.log(data);
                        if (data.length > 0) {
                            var layer = "";
                            layer = "<table id='aa'>";
                            $.each(data, function (idx, item) {
                                layer += "<tr class='line1' id='"+item.id+"'><td class='std1'>" + item.name+ "</td></tr>";
                            });
                            layer += "</table>";

                            //将结果添加到div中
                            $("#searchresult1").empty();
                            $("#searchresult1").append(layer);
                            $(".line1:first").addClass("hover");
                            $("#searchresult1").css("display", "");
                            //鼠标移动事件

                            $(".line1").hover(function () {
                                $(".line1").removeClass("hover");
                                $(this).addClass("hover");
                            }, function () {
                                $(this).removeClass("hover");
                                //$("#searchresult").css("display", "none");
                            });
                            //鼠标点击事件
                            $(".line1").click(function () {
                                $("#"+id).val($(this).text());
                                $("#"+id+"0").val($(this).attr("id"));
                                tt($(this).attr("id"),idx);
                                $("#searchresult1").css("display", "none");
                            });
                        } else {
                            $("#searchresult1").empty();
                            $("#searchresult1").css("display", "none");
                        }
                    }
                });
            }
            else if (k == 38) {//上箭头
                $('#aa tr.hover').prev().addClass("hover");
                $('#aa tr.hover').next().removeClass("hover");
                $("#"+id).val($('#aa tr.hover').text());
            }
            else if (k == 40) {//下箭头
                $('#aa tr.hover').next().addClass("hover");
                $('#aa tr.hover').prev().removeClass("hover");
                $("#"+id).val($('#aa tr.hover').text());
            }

            else {
                $("#searchresult1").empty();
                $("#searchresult1").css("display", "none");
            }
        }
        function se(evt) {
            ChangeCoords(); //控制查询结果div坐标

            var k = window.event ? evt.keyCode : evt.which;
            //输入框的id为txt_search，这里监听输入框的keyup事件
            //不为空 && 不为上箭头或下箭头或回车
            if ($("#productionPlace").val() != "" && k == 13) {
                $.ajax({
                    type: 'post',
                    async: true, //同步执行，不然会有问题
                    dataType: "json",
                    url: "${ctx}/infor/productAddress/getplace?name="+$("#productionPlace").val(),   //提交的页面/方法
                    error: function (msg) {//请求失败处理函数
                        alert("数据加载失败");
                    },
                    success: function (data) { //请求成功后处理函数。
						/*  var objData = eval("(" + data.userName + ")");   */
                        console.log(data);
                        if (data.length > 0) {
                            var layer = "";
                            layer = "<table id='aa'>";
                            $.each(data, function (idx, item) {
                                layer += "<tr class='line' id='"+item.code+"'><td class='std'>" + item.name+ "</td></tr>";
                            });
                            layer += "</table>";

                            //将结果添加到div中
                            $("#searchresult").empty();
                            $("#searchresult").append(layer);
                            $(".line:first").addClass("hover");
                            $("#searchresult").css("display", "");
                            //鼠标移动事件

                            $(".line").hover(function () {
                                $(".line").removeClass("hover");
                                $(this).addClass("hover");
                            }, function () {
                                $(this).removeClass("hover");
                                //$("#searchresult").css("display", "none");
                            });
                            //鼠标点击事件
                            $(".line").click(function () {
                                $("#productionPlace").val($(this).text());
                                $("#originCode").val($(this).attr("id"));
                                $("#searchresult").css("display", "none");
                            });
                        } else {
                            $("#searchresult").empty();
                            $("#searchresult").css("display", "none");
                        }
                    }
                });
            }
            else if (k == 38) {//上箭头
                $('#aa tr.hover').prev().addClass("hover");
                $('#aa tr.hover').next().removeClass("hover");
                $("#productionPlace").val($('#aa tr.hover').text());
            }
            else if (k == 40) {//下箭头
                $('#aa tr.hover').next().addClass("hover");
                $('#aa tr.hover').prev().removeClass("hover");
                $("#productionPlace").val($('#aa tr.hover').text());
            }
            else {
                $("#searchresult").empty();
                $("#searchresult").css("display", "none");
            }
        }
        $("#searchresult").bind("mouseleave", function () {
            $("#searchresult").empty();
            $("#searchresult").css("display", "none");
        });
        $("#searchresult1").bind("mouseleave", function () {
            $("#searchresult1").empty();
            $("#searchresult1").css("display", "none");
        });
        function se1(evt,id,idx) {
            ChangeCoords2(id); //控制查询结果div坐标

            var k = window.event ? evt.keyCode : evt.which;
            //输入框的id为txt_search，这里监听输入框的keyup事件
            //不为空 && 不为上箭头或下箭头或回车
            if ($("#"+id).val() != "" && k == 13) {
                $.ajax({
                    type: 'post',
                    async: true, //同步执行，不然会有问题
                    dataType: "json",
                    url: "${ctx}/infor/goods/getGoodsByCode?code="+$("#"+id).val(),   //提交的页面/方法
                    error: function (msg) {//请求失败处理函数
                        alert("数据加载失败");
                    },
                    success: function (data) { //请求成功后处理函数。
						/*  var objData = eval("(" + data.userName + ")");   */
                        console.log(data);
                        if (data.length > 0) {
                            var layer = "";
                            layer = "<table id='aa2'>";
                            $.each(data, function (idx, item) {
                                layer += "<tr class='line2' id='"+item.id+"'><td class='std2'>" + item.code+ "</td></tr>";
                            });
                            layer += "</table>";

                            //将结果添加到div中
                            $("#searchresult2").empty();
                            $("#searchresult2").append(layer);
                            $(".line1:first").addClass("hover");
                            $("#searchresult2").css("display", "");
                            //鼠标移动事件

                            $(".line2").hover(function () {
                                $(".line2").removeClass("hover");
                                $(this).addClass("hover");
                            }, function () {
                                $(this).removeClass("hover");
                                //$("#searchresult").css("display", "none");
                            });
                            //鼠标点击事件
                            $(".line2").click(function () {
                                $("#"+id).val($(this).text());
                                tt1($(this).attr("id"),idx);
                                $("#searchresult2").css("display", "none");
                            });
                        } else {
                            $("#searchresult2").empty();
                            $("#searchresult2").css("display", "none");
                        }
                    }
                });
            }
            else if (k == 38) {//上箭头
                $('#aa2 tr.hover').prev().addClass("hover");
                $('#aa2 tr.hover').next().removeClass("hover");
                $("#"+id).val($('#aa tr.hover').text());
            }
            else if (k == 40) {//下箭头
                $('#aa2 tr.hover').next().addClass("hover");
                $('#aa2 tr.hover').prev().removeClass("hover");
                $("#"+id).val($('#aa tr.hover').text());
            }

            else {
                $("#searchresult2").empty();
                $("#searchresult2").css("display", "none");
            }
        }
        $("#searchresult2").bind("mouseleave", function () {
            $("#searchresult2").empty();
            $("#searchresult2").css("display", "none");
        });
        function ChangeCoords2(id) {
            //    var left = $("#txt_search")[0].offsetLeft; //获取距离最左端的距离，像素，整型
            //    var top = $("#txt_search")[0].offsetTop + 26; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            var left = $("#"+id).position().left; //获取距离最左端的距离，像素，整型
            var top = $("#"+id).position().top + 30; ; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            $("#searchresult2").css("left", left + "px"); //重新定义CSS属性
            $("#searchresult2").css("top", top + "px"); //同上
        }
        function ChangeCoords1(id) {
            //    var left = $("#txt_search")[0].offsetLeft; //获取距离最左端的距离，像素，整型
            //    var top = $("#txt_search")[0].offsetTop + 26; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            var left = $("#"+id).position().left; //获取距离最左端的距离，像素，整型
            var top = $("#"+id).position().top + 30; ; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            $("#searchresult1").css("left", left + "px"); //重新定义CSS属性
            $("#searchresult1").css("top", top + "px"); //同上
        }
        function ChangeCoords() {
            //    var left = $("#txt_search")[0].offsetLeft; //获取距离最左端的距离，像素，整型
            //    var top = $("#txt_search")[0].offsetTop + 26; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            var left = $("#productionPlace").position().left; //获取距离最左端的距离，像素，整型
            var top = $("#productionPlace").position().top + 30; ; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            $("#searchresult").css("left", left + "px"); //重新定义CSS属性
            $("#searchresult").css("top", top + "px"); //同上
        }
        function js(val,idx) {
            if(val==""){
                val="0";
            }
            var a=parseInt(val);
            var id= $("#materialParticularsList"+idx+"_materialName0").val() ;
            $.ajax({
                url:'${ctx}/infor/goods/getById?i='+id,
                success:function (data) {
                    var gw=parseFloat(data.grossWeight);
                    var v=parseFloat(data.volume);
                    var w=parseFloat(data.weight);
                    $("#materialParticularsList"+idx+"_weight").val(parseFloat((w*a).toFixed(5))) ;
                    $("#materialParticularsList"+idx+"_roughWeight").val(parseFloat((gw*a).toFixed(5))) ;
                    $("#materialParticularsList"+idx+"_volume").val(parseFloat((v*a).toFixed(5))) ;
                }
            })

        }
        //物流商
        function se5(evt) {
            ChangeCoords5(); //控制查询结果div坐标
            var k = window.event ? evt.keyCode : evt.which;
            //输入框的id为txt_search，这里监听输入框的keyup事件
            //不为空 && 不为上箭头或下箭头或回车
            if ($("#logisticsName").val() != "" && k == 13) {
                $.ajax({
                    type: 'post',
                    async: true, //同步执行，不然会有问题
                    dataType: "json",
                    url: "${ctx}/infor/organization/getByName?name="+$("#logisticsName").val(),   //提交的页面/方法
                    error: function (msg) {//请求失败处理函数
                        alert("数据加载失败");
                    },
                    success: function (data) { //请求成功后处理函数。
						/*  var objData = eval("(" + data.userName + ")");   */
                        console.log(data);
                        if (data.length > 0) {
                            var layer = "";
                            layer = "<table id='aa5'>";
                            $.each(data, function (idx, item) {
                                layer += "<tr class='line5' name='"+item.phone+"' id='"+item.person+"'><td class='std'>" + item.name+ "</td></tr>";
                            });
                            layer += "</table>";

                            //将结果添加到div中
                            $("#searchresult5").empty();
                            $("#searchresult5").append(layer);
                            $(".line5:first").addClass("hover");
                            $("#searchresult5").css("display", "");
                            //鼠标移动事件

                            $(".line5").hover(function () {
                                $(".line5").removeClass("hover");
                                $(this).addClass("hover");
                            }, function () {
                                $(this).removeClass("hover");
                                //$("#searchresult").css("display", "none");
                            });
                            //鼠标点击事件
                            $(".line5").click(function () {
                                $("#logisticsName").val($(this).text());
                                $("#name").val(this.id);
                                $("#phone").val($(this).attr("name"));
                                $("#searchresult5").css("display", "none");
                            });
                        } else {
                            $("#searchresult5").empty();
                            $("#searchresult5").css("display", "none");
                        }
                    }
                });
            }
            else if (k == 38) {//上箭头
                $('#aa5 tr.hover').prev().addClass("hover");
                $('#aa5 tr.hover').next().removeClass("hover");
                $('#logisticsName').val($('#aa5 tr.hover').text());
            }
            else if (k == 40) {//下箭头
                $('#aa5 tr.hover').next().addClass("hover");
                $('#aa5 tr.hover').prev().removeClass("hover");
                $('#logisticsName').val($('#aa5 tr.hover').text());
            }

            else {
                $("#searchresult5").empty();
                $("#searchresult5").css("display", "none");
            }
        };
        $("#searchresult5").bind("mouseleave", function () {
            $("#searchresult5").empty();
            $("#searchresult5").css("display", "none");
        });
        function ChangeCoords5() {
            //    var left = $("#txt_search")[0].offsetLeft; //获取距离最左端的距离，像素，整型
            //    var top = $("#txt_search")[0].offsetTop + 26; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            var left = $("#logisticsName").position().left; //获取距离最左端的距离，像素，整型
            var top = $("#logisticsName").position().top + 30; ; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            $("#searchresult5").css("left", left + "px"); //重新定义CSS属性
            $("#searchresult5").css("top", top + "px"); //同上
        }
        //司机
        function se6(evt) {
            ChangeCoords6(); //控制查询结果div坐标
            var k = window.event ? evt.keyCode : evt.which;
            //输入框的id为txt_search，这里监听输入框的keyup事件
            //不为空 && 不为上箭头或下箭头或回车
            if ($("#driverName").val() != "" && k == 13) {
                $.ajax({
                    type: 'post',
                    async: true, //同步执行，不然会有问题
                    dataType: "json",
                    url: "${ctx}/infor/driver/getDriver?name="+$("#driverName").val(),   //提交的页面/方法
                    error: function (msg) {//请求失败处理函数
                        alert("数据加载失败");
                    },
                    success: function (data) { //请求成功后处理函数。
						/*  var objData = eval("(" + data.userName + ")");   */
                        console.log(data);
                        if (data.length > 0) {
                            var layer = "";
                            layer = "<table id='aa6'>";
                            $.each(data, function (idx, item) {
                                layer += "<tr class='line6'  id='"+item.phone+"'><td class='std'>" + item.name+ "</td></tr>";
                            });
                            layer += "</table>";

                            //将结果添加到div中
                            $("#searchresult6").empty();
                            $("#searchresult6").append(layer);
                            $(".line6:first").addClass("hover");
                            $("#searchresult6").css("display", "");
                            //鼠标移动事件

                            $(".line6").hover(function () {
                                $(".line6").removeClass("hover");
                                $(this).addClass("hover");
                            }, function () {
                                $(this).removeClass("hover");
                                //$("#searchresult").css("display", "none");
                            });
                            //鼠标点击事件
                            $(".line6").click(function () {
                                $("#driverName").val($(this).text());
                                $("#driverPhone").val(this.id);
                                $("#searchresult6").css("display", "none");
                            });
                        } else {
                            $("#searchresult6").empty();
                            $("#searchresult6").css("display", "none");
                        }
                    }
                });
            }
            else if (k == 38) {//上箭头
                $('#aa6 tr.hover').prev().addClass("hover");
                $('#aa6 tr.hover').next().removeClass("hover");
                $('#driverName').val($('#aa6 tr.hover').text());
            }
            else if (k == 40) {//下箭头
                $('#aa6 tr.hover').next().addClass("hover");
                $('#aa6 tr.hover').prev().removeClass("hover");
                $('#driverName').val($('#aa6 tr.hover').text());
            }

            else {
                $("#searchresult6").empty();
                $("#searchresult6").css("display", "none");
            }
        };
        $("#searchresult6").bind("mouseleave", function () {
            $("#searchresult6").empty();
            $("#searchresult6").css("display", "none");
        });
        function ChangeCoords6() {
            //    var left = $("#txt_search")[0].offsetLeft; //获取距离最左端的距离，像素，整型
            //    var top = $("#txt_search")[0].offsetTop + 26; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            var left = $("#driverName").position().left; //获取距离最左端的距离，像素，整型
            var top = $("#driverName").position().top + 30; ; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            $("#searchresult6").css("left", left + "px"); //重新定义CSS属性
            $("#searchresult6").css("top", top + "px"); //同上
        }
	</script>
</head>
<body class="bg-white">
<form:form id="inputForm" modelAttribute="storageInform" action="${ctx}/wms/storageInform/save" method="post" class="form-horizontal">
  <form:hidden path="id"/>
    <sys:message content="${message}"/>
<ul class="nav nav-tabs">
	<li class="active"><a data-toggle="tab" href="#tab-01" aria-expanded="true">基础信息</a>
	</li>
	<li class=""><a data-toggle="tab" href="#tab-02" aria-expanded="false">服务信息</a>
	</li>

</ul>


	<div class="tab-content">
	<div id="tab-01" class="tab-pane fade in  active">
		<table class="table table-bordered">
			<tbody>
			<tr>
				<td class="width-15 active"><label class="pull-right">入库通知单号：</label></td>
				<td class="width-35">
					<form:input readonly="true" path="storageNumber" htmlEscape="false"    class="form-control "/>
				</td>
				<td class="width-15 active"><label class="pull-right">货主代码：</label></td>
				<td class="width-35">
					<form:input path="shipperCode" htmlEscape="false"    class="form-control "/>
				</td>
			</tr>
			<tr>
				<td class="width-15 active"><label class="pull-right">项目名称：</label></td>
				<td class="width-35">
					<input name="projectName"  <c:if test="${fns:getUseroffice()!='总部'}">readonly="readonly"</c:if> htmlEscape="false" value="${storageInform.projectName}"   class="form-control "/>
				</td>
				<td class="width-15 active"><label class="pull-right">到货日期：</label></td>
				<td class="width-35">
					<div class='input-group form_datetime' id='arrivalDate'>
						<input type='text'  name="arrivalDate" class="form-control "  value="<fmt:formatDate value="${storageInform.arrivalDate}" pattern="yyyy-MM-dd HH:00"/>"/>
						<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
					</div>
				</td>
			</tr>
			<tr>
				<td class="width-15 active"><label class="pull-right">状态：</label></td>
				<td class="width-35">
					<form:input path="state" htmlEscape="false"  readonly="true"  class="form-control "/>
				</td>
				<td class="width-15 active"><label class="pull-right">入库类型：</label></td>
				<td class="width-35">
					<form:select path="storageType" class="form-control ">
						<form:options items="${fns:getDictList('storage_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</form:select>
				</td>
			</tr>
			<tr>

				<td class="width-15 active"><label class="pull-right">总预期量：</label></td>
				<td class="width-35">
					<form:input path="forecast" htmlEscape="false"   readonly="true"  class="form-control "/>
				</td>
				<td class="width-15 active"><label class="pull-right">总接收量：</label></td>
				<td class="width-35">
					<form:input path="quantitiesReceived" htmlEscape="false"   readonly="true"  class="form-control "/>
				</td>
			</tr>

			<tr>

				<td class="width-15 active"><label class="pull-right">总毛重：</label></td>
				<td class="width-35">
					<form:input path="roughWeight" htmlEscape="false"   readonly="true"  class="form-control "/>
				</td>
				<td class="width-15 active"><label class="pull-right">总体积：</label></td>
				<td class="width-35">
					<form:input path="totalVolume"  htmlEscape="false"  readonly="true"   class="form-control "/>
				</td>
			</tr>
			<tr>

				<td class="width-15 active"><label class="pull-right"><span style="color: red">*</span>供货地：</label></td>
				<td class="width-35">
					<form:input path="productionPlace" htmlEscape="false"    class="form-control required"/>
					<div id="searchresult" style="display: none;"></div>
				</td>
				<td class="width-10 active"><label class="pull-right">作业类型：</label></td>
				<td class="width-23">
					<form:select path="type" class="form-control ">
						<form:options items="${fns:getDictList('workType')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</form:select>
				</td>
			</tr>
			<tr>

				<td class="width-15 active"><label class="pull-right"><span style="color: red">*</span>装运单号(货主单号)：</label></td>
				<td class="width-35">
					<form:input path="shippingNumber" htmlEscape="false"    class="form-control required"/>
				</td>
				<td class="width-15 active"><label class="pull-right">交货单号：</label></td>
				<td class="width-35">
					<form:input path="deliveryNumber" htmlEscape="false"    class="form-control "/>
				</td>
			</tr>
			</tbody>
		</table>
		<div class="tabs-container">
			<ul class="nav nav-tabs">
				<li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">物料详情：</a>
				</li>

			</ul>
			<div class="tab-content">
				<div id="tab-1" class="tab-pane fade in  active">
			<a class="btn btn-white btn-sm" onclick="addRow('#materialParticularsList', materialParticularsRowIdx, materialParticularsTpl);materialParticularsRowIdx = materialParticularsRowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增</a>
			<table class="table table-striped table-bordered table-condensed">
				<thead>
				<tr>
					<th class="hide"></th>
					<th width="11%"><span style="color: red">*</span>交货单号</th>
					<th width="14%"><span style="color: red">*</span>物料编码</th>
					<th width="30%"><span style="color: red">*</span>物料名称</th>
					<th width="10%">物料规格</th>
					<th width="7%">物料类型</th>
					<th width="7%">包装单位</th>
					<th width="7%"><span style="color: red">*</span>预期量</th>
					<th width="7%">毛重(吨)</th>
					<th width="8%">体积(M3)</th>

					<th width="10">&nbsp;</th>
				</tr>
				</thead>
				<tbody id="materialParticularsList">
				</tbody>
			</table>
			<script type="text/template" id="materialParticularsTpl">//<!--
				<tr id="materialParticularsList{{idx}}">
					<td class="hide">
						<input id="materialParticularsList{{idx}}_id" name="materialParticularsList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
						<input id="materialParticularsList{{idx}}_delFlag" name="materialParticularsList[{{idx}}].delFlag" type="hidden" value="0"/>
											<input id="materialParticularsList{{idx}}_idx" name="materialParticularsList[{{idx}}].idx" type="hidden" value="{{idx}}"    class="form-control required"/>

					</td>




	<td>
						<input id="materialParticularsList{{idx}}_goodsNumber" name="materialParticularsList[{{idx}}].goodsNumber" type="text" value="{{row.goodsNumber}}"    class="form-control required"/>
					</td>


                    <td>
                    <input id="materialParticularsList{{idx}}_materialCode" name="materialParticularsList[{{idx}}].materialCode" type="text" value="{{row.materialCode}}" onkeyup="se1(event,this.id,'{{idx}}')"    class="form-control required "/>
					<div id="searchresult2" style="display: none;"></div>
					</td>

					<td>
					<input id="materialParticularsList{{idx}}_materialName" name="materialParticularsList[{{idx}}].materialName.name" type="text" value="{{row.materialName.name}}" onkeyup="se0(event,this.id,'{{idx}}')"   class="form-control " />
                    <input  id="materialParticularsList{{idx}}_materialName0" name="materialParticularsList[{{idx}}].materialName.id" type="hidden" value="{{row.materialName.id}}"    class="form-control " />

                    <div id="searchresult1" style="display: none;"></div>
					</td>
					<td>
						<input id="materialParticularsList{{idx}}_materialSpecification" name="materialParticularsList[{{idx}}].materialSpecification" type="text" value="{{row.materialSpecification}}"    class="form-control "/>
					</td>




					<td>
						<input id="materialParticularsList{{idx}}_packing" name="materialParticularsList[{{idx}}].packing" type="text" value="{{row.packing}}"    class="form-control "/>
					</td>
					<td>
						<input id="materialParticularsList{{idx}}_packingUnit" name="materialParticularsList[{{idx}}].packingUnit" type="text" value="{{row.packingUnit}}"    class="form-control "/>
					</td>

<td>
						<input id="materialParticularsList{{idx}}_forecast" name="materialParticularsList[{{idx}}].forecast" type="text" value="{{row.forecast}}" onblur="js(this.value,'{{idx}}')"   class="form-control required"/>
					</td>



					<td>
						<input id="materialParticularsList{{idx}}_roughWeight" name="materialParticularsList[{{idx}}].roughWeight" type="text" value="{{row.roughWeight}}"    class="form-control "/>
					</td>


					<td>
						<input id="materialParticularsList{{idx}}_volume" name="materialParticularsList[{{idx}}].volume" type="text" value="{{row.volume}}"    class="form-control "/>
					</td>






					<td class="text-center" width="10">
						{{#delBtn}}<span class="close" onclick="delRow(this, '#materialParticularsList{{idx}}')" title="删除">&times;</span>{{/delBtn}}
					</td>
				</tr>//-->
			</script>

			<script type="text/javascript">
                var materialParticularsRowIdx = 0, materialParticularsTpl = $("#materialParticularsTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                $(document).ready(function() {
                    var data = ${fns:toJson(storageInform.materialParticularsList)};
                    for (var i=0; i<data.length; i++){
                        addRow('#materialParticularsList', materialParticularsRowIdx, materialParticularsTpl, data[i]);
                        materialParticularsRowIdx = materialParticularsRowIdx + 1;
                    }
                });
			</script>
		</div>
		</div>
		</div>
</div>
		<div id="tab-02" class="tab-pane fade  ">
			<table class="table table-bordered">
				<tbody>
				<tr>
					<td class="width-15 active"><label class="pull-right"><span style="color: red">*</span>物流商名称：</label></td>
					<td class="width-35">
						<input id="logisticsName" name="providerName" onkeyup="se5(event)" autocomplete="off" htmlEscape="false" value="${storageInform.providerName}"   class="form-control required"/>
						<div id="searchresult5" style="display: none;"></div>

					</td>
					<td class="width-15 active"><label class="pull-right">联系人：</label></td>
					<td class="width-35">
						<form:input path="name" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">联系人电话：</label></td>
					<td class="width-35">
						<form:input path="phone" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right"><span style="color: red">*</span>车牌号码：</label></td>
					<td class="width-35">
						<form:input path="number" htmlEscape="false"    class="form-control  "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><span style="color: red">*</span>司机姓名：</label></td>
					<td class="width-35">
						<input id="driverName" name="driverName" onkeyup="se6(event)" autocomplete="off" htmlEscape="false" value="${storageInform.driverName}"   class="form-control required"/>
						<div id="searchresult6" style="display: none;"></div>

					</td>
					<td class="width-15 active"><label class="pull-right"><span style="color: red">*</span>司机电话：</label></td>
					<td class="width-35">
						<form:input path="driverPhone" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">运输方式：</label></td>
					<td class="width-35">
						<form:input path="transportationWay" htmlEscape="false"    class="form-control "/>
					</td>

					<td class="width-15 active"><label class="pull-right">货主名称：</label></td>
					<td class="width-35">
						<form:input path="ownerName" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">地址：</label></td>
					<td class="width-35">
						<form:input path="site" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">货主联系人：</label></td>
					<td class="width-35">
						<form:input path="ownerContacts" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">货主电话：</label></td>
					<td class="width-35">
						<form:input path="ownerPhone" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">物流订单号：</label></td>
					<td class="width-35">
						<form:input path="logisticsBumber" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">货主系统名称：</label></td>
					<td class="width-35">
						<form:input path="systemName" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">备注信息：</label></td>
					<td class="width-35">
						<form:input path="remarks" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				</tbody>
			</table>

		</div>

</div>

		</form:form>

</body>
</html>